package com.bjpowernode.redis;

import redis.clients.jedis.Jedis;

import java.util.List;

public class JedisDemo {

    public static void main(String[] args) {
        // 创建Jedis对象
        Jedis jedis = new Jedis("192.168.58.111",6379);
        //清空数据库
        //jedis.flushAll();
        //jedis.set("jedis1","aaa");
        //jedis.mset("jedis2","bbb","jedis3","ccc","jedis4","ddd");
        List<String> mget = jedis.mget("jedis1", "jedis2");
        for (String s : mget) {
            System.out.println(s);
        }


        // 关闭资源
        jedis.close();

    }
}
